<template>
  <el-cascader
    v-model="dataValue"
    :disabled="disabled"
    @change="valueChange"
    :placeholder="attrs.placeholder ? attrs.placeholder : `请选择${label}`"
    style="width: 100%;"
    :options="options"
    :clearable="attrs.clearable"
    :show-all-levels="attrs.showAllLevels"
    :collapse-tags="attrs.collapseTags"
    :filterable="attrs.filterable"
    :props="{
      expandTrigger: attrs.expandTrigger,
      multiple: attrs.multiple,
      lazy: attrs.lazy,
      lazyLoad: attrs.lazyLoad,
    }"
  >
  <template slot-scope="{ node, data }">
    <span v-if="!attrs.template">{{ data.label }}</span>
    <component v-else :is="attrs.template" :data="data" :node="node"  />
  </template>
  </el-cascader>
</template>
<script type="text/javascript">
import XMixIn from './XMixIn'
export default {
  mixins: [XMixIn],
  props: {
    options: {
      type: [Array],
      default: Array
    }
  }
}
</script>
